package utils;

import java.util.Random;

/**
 * 功能描述:
 *
 * @author liping(lpaidd50@gmail.com)
 * @version v1.0
 * @date 2016/8/9
 */
public class RandomStringGenerator {
	/**
	 * 获取一定长度的随机字符串
	 * @return 一定长度的字符串
	 */
	public static String getRandomStringByLength() {
		int length = 32;
		String base = "abcdefghijklmnopqrstuvwxyz0123456789";
		Random random = new Random();
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < length; i++) {
			int number = random.nextInt(base.length());
			sb.append(base.charAt(number));
		}
		return sb.toString();
	}
}
